package com.maiji.cloud.controller;

import com.maiji.cloud.entities.login.ShareWeightHelpRule;
import com.maiji.cloud.entities.login.ShareWeightRuleEntity;
import com.maiji.cloud.entities.login.SignInDeployEntity;
import com.maiji.cloud.entities.shopingmall.*;
import com.maiji.cloud.request.BaseDataReqDto;
import com.maiji.cloud.request.shopingmall.MongoLogFindReqData;
import com.maiji.cloud.response.BaseDataResDto;
import com.maiji.cloud.response.BaseMetaResDto;
import com.maiji.cloud.response.BaseResDto;
import com.maiji.cloud.response.login.ActivityShareRuleConfigResData;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

@RestController
@RequestMapping("/maijiSettings/")
public class MaijiSettingsController extends BaseController {
    
    /**
     * 编辑基金或积分使用规则
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("editRuleFundIntegral")
    @ApiOperation(value = "编辑基金或积分使用规则")
    public BaseResDto editRuleFundIntegral (@RequestBody BaseDataReqDto<RuleFundIntegral_log> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_SHOPINGMALL + "/maijiSettings/editRuleFundIntegral", baseDataReqDto, BaseResDto.class);
    }

    /**
     * 获取基金或积分使用规则列表
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("findAllRuleFundIntegrals")
    @ApiOperation(value = "获取基金或积分使用规则列表")
    public BaseMetaResDto<List<RuleFundIntegral>> findAllRuleFundIntegrals (@RequestBody BaseDataReqDto<Integer> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_SHOPINGMALL + "/maijiSettings/findAllRuleFundIntegrals", baseDataReqDto, BaseMetaResDto.class);
    }

    /**
     * 获取减重分享规则修改记录列表
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("findAllRuleFundIntegral_logs")
    @ApiOperation(value = "获取减重分享规则修改记录列表")
    public BaseMetaResDto<List<RuleFundIntegral_log>> findAllRuleFundIntegral_logs(@RequestBody BaseDataReqDto<MongoLogFindReqData> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_SHOPINGMALL + "/maijiSettings/findAllRuleFundIntegral_logs", baseDataReqDto, BaseMetaResDto.class);
    }

    /**
     * 修改连续签到得积分规则
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("editSignInDeploy")
    @ApiOperation(value = "修改连续签到得积分规则")
    public BaseResDto editSignInDeploy (@RequestBody BaseDataReqDto<SignInDeployEntity> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_APPLOGIN + "/maijiSettings/editSignInDeploy", baseDataReqDto, BaseResDto.class);
    }

    /**
     * 获取连续签到得积分规则修改记录列表
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("findAllSignInDeployLogs")
    @ApiOperation(value = "获取连续签到得积分规则修改记录列表")
    public BaseDataResDto<List<SignInDeployEntity>> findAllSignInDeployLogs (@RequestBody BaseDataReqDto<List<Date>> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_APPLOGIN + "/maijiSettings/findAllSignInDeployLogs", baseDataReqDto, BaseDataResDto.class);
    }

    /**
     * 获取连续签到得积分规则
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("findAllSignInDeploys")
    @ApiOperation(value = "获取连续签到得积分规则")
    public BaseDataResDto<List<SignInDeployEntity>> findAllSignInDeploys(@RequestBody BaseDataReqDto baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_APPLOGIN + "/maijiSettings/findAllSignInDeploys", baseDataReqDto, BaseDataResDto.class);
    }

    /**
     * 编辑积分分发规则
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("editTask")
    @ApiOperation(value = "编辑积分分发规则")
    public BaseResDto editTask (@RequestBody BaseDataReqDto<TaskLog> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_SHOPINGMALL + "/maijiSettings/editTask", baseDataReqDto, BaseResDto.class);
    }

    /**
     * 获取积分分发规则列表
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("findAllTasks")
    @ApiOperation(value = "获取积分分发规则列表")
    public BaseMetaResDto<List<TaskEntity>> findAllTasks (@RequestBody BaseDataReqDto baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_SHOPINGMALL + "/maijiSettings/findAllTasks", baseDataReqDto, BaseMetaResDto.class);
    }

    /**
     * 获取积分分发修改记录列表
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("findAllTaskLogs")
    @ApiOperation(value = "获取积分分发修改记录列表")
    public BaseMetaResDto<List<TaskLog>> findAllTaskLogs (@RequestBody BaseDataReqDto<List<Date>> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_SHOPINGMALL + "/maijiSettings/findAllTaskLogs", baseDataReqDto, BaseMetaResDto.class);
    }

    /**
     * 编辑优惠券使用规则
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("editDiscountCoupon")
    @ApiOperation(value = "编辑优惠券使用规则")
    public BaseResDto editDiscountCoupon (@RequestBody BaseDataReqDto<DiscountCouponLog> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_SHOPINGMALL + "/maijiSettings/editDiscountCoupon", baseDataReqDto, BaseResDto.class);
    }

    /**
     * 获取优惠券规则列表
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("findAllDiscountCoupons")
    @ApiOperation(value = "获取优惠券规则列表")
    public BaseMetaResDto<List<DiscountCoupon>> findAllDiscountCoupons (@RequestBody BaseDataReqDto<DiscountCoupon> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_SHOPINGMALL + "/maijiSettings/findAllDiscountCoupons", baseDataReqDto, BaseMetaResDto.class);
    }

    /**
     * 获取优惠券规则修改记录列表
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("findAllDiscountCouponLogs")
    @ApiOperation(value = "获取优惠券规则修改记录列表")
    public BaseMetaResDto<List<DiscountCouponLog>> findAllDiscountCouponLogs(@RequestBody BaseDataReqDto<MongoLogFindReqData> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_SHOPINGMALL + "/maijiSettings/findAllDiscountCouponLogs", baseDataReqDto, BaseMetaResDto.class);
    }

    /**
     * 修改基础减肥基金规则
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("updShareWeightRule")
    @ApiOperation(value = "修改基础减肥基金规则")
    public BaseResDto updShareWeightRule (@RequestBody BaseDataReqDto<ShareWeightRuleEntity> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_APPLOGIN + "/maijiSettings/updShareWeightRule", baseDataReqDto, BaseResDto.class);
    }

    /**
     * 获取基础减肥基金规则
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("findShareWeightRule")
    @ApiOperation(value = "获取基础减肥基金规则")
    public BaseDataResDto<ShareWeightRuleEntity> findShareWeightRule (@RequestBody BaseDataReqDto<ShareWeightRuleEntity> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_APPLOGIN + "/maijiSettings/findShareWeightRule", baseDataReqDto, BaseDataResDto.class);
    }

    /**
     * 获取体重分享助力规则修改记录列表
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("findAllShareWeightRuleLogs")
    @ApiOperation(value = "获取体重分享助力规则修改记录列表")
    public BaseDataResDto<List<ShareWeightRuleEntity>> findAllShareWeightRuleLogs(@RequestBody BaseDataReqDto<List<Date>> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_APPLOGIN + "/maijiSettings/findAllShareWeightRuleLogs", baseDataReqDto, BaseDataResDto.class);
    }

    /**
     * 修改减重分享规则
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("updShareWeightHelpRule")
    @ApiOperation(value = "修改减重分享规则")
    public BaseResDto updShareWeightHelpRule(@RequestBody BaseDataReqDto<ShareWeightHelpRule> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_APPLOGIN + "/maijiSettings/updShareWeightHelpRule", baseDataReqDto, BaseResDto.class);
    }

    /**
     * 获取减重分享规则
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("findShareWeightHelpRule")
    @ApiOperation(value = "获取减重分享规则")
    public BaseDataResDto<ShareWeightHelpRule> findShareWeightHelpRule(@RequestBody BaseDataReqDto<ShareWeightHelpRule> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_APPLOGIN + "/maijiSettings/findShareWeightHelpRule", baseDataReqDto, BaseDataResDto.class);
    }

    /**
     * 获取减重分享规则修改记录列表
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("findAllShareWeightHelpRuleLogs")
    @ApiOperation(value = "获取减重分享规则修改记录列表")
    public BaseDataResDto<List<ShareWeightHelpRule>> findAllShareWeightHelpRuleLogs(@RequestBody BaseDataReqDto<List<Date>> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_APPLOGIN + "/maijiSettings/findAllShareWeightHelpRuleLogs", baseDataReqDto, BaseDataResDto.class);
    }

    /**
     * 获取分享封面和页面配置
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("findShareRuleConfig")
    @ApiOperation(value = "获取分享封面和页面配置")
    public BaseDataResDto<ActivityShareRuleConfigResData> findShareRuleConfig(@RequestBody BaseDataReqDto<Integer> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_APPLOGIN + "/maijiSettings/findShareRuleConfig", baseDataReqDto, BaseDataResDto.class);
    }

    /**
     * 修改分享封面和页面配置
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("add_updShareRuleConfig")
    @ApiOperation(value = "修改分享封面和页面配置")
    public BaseResDto add_updShareRuleConfig(@RequestBody BaseDataReqDto<ActivityShareRuleConfigResData> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_APPLOGIN + "/maijiSettings/add_updShareRuleConfig", baseDataReqDto, BaseResDto.class);
    }

    /**
     * 获取提现金额限制数据
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("findWithdrawalAmountLimitConfig")
    @ApiOperation(value = "获取提现金额限制数据")
    public BaseDataResDto<WithdrawalAmountLimitConfigEntity> findWithdrawalAmountLimitConfig(@RequestBody BaseDataReqDto<Integer> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_SHOPINGMALL + "/maijiSettings/findWithdrawalAmountLimitConfig", baseDataReqDto, BaseDataResDto.class);
    }

    /**
     * 获取提现金额限制数据编辑记录
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("findAllWithdrawalAmountLimitConfigLogs")
    @ApiOperation(value = "获取提现金额限制数据编辑记录")
    public BaseDataResDto<List<WithdrawalAmountLimitConfigEntity>> findAllWithdrawalAmountLimitConfigLogs(@RequestBody BaseDataReqDto<List<Date>> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_SHOPINGMALL + "/maijiSettings/findAllWithdrawalAmountLimitConfigLogs", baseDataReqDto, BaseDataResDto.class);
    }

    /**
     * 配置提现金额
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("editWithdrawalAmountLimitConfig")
    @ApiOperation(value = "配置提现金额")
    public BaseResDto editWithdrawalAmountLimitConfig(@RequestBody BaseDataReqDto<WithdrawalAmountLimitConfigEntity> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_SHOPINGMALL + "/maijiSettings/editWithdrawalAmountLimitConfig", baseDataReqDto, BaseResDto.class);
    }

    /**
     * 设置订单自动收货设置
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("findAndSetOrderAutoSet")
    @ApiOperation(value = "设置订单自动收货设置")
    public BaseDataResDto<HashMap> findAndSetOrderAutoSet(@RequestBody BaseDataReqDto<HashMap> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_SHOPINGMALL + "/maijiSettings/findAndSetOrderAutoSet", baseDataReqDto, BaseDataResDto.class);
    }

    /**
     * 设置打印机型号
     * @param baseDataReqDto
     * @return
     */
    @PostMapping("find_setPrinterModel")
    @ApiOperation(value = "设置打印机型号")
    public BaseDataResDto<HashMap> find_setPrinterModel(@RequestBody BaseDataReqDto<HashMap> baseDataReqDto) {
        return restTemplate.postForObject(REST_URL_SHOPINGMALL + "/maijiSettings/find_setPrinterModel", baseDataReqDto, BaseDataResDto.class);
    }

}
